package LC;

// 二分法
public class LC278 {
    // 模拟
    static boolean isBadVersion (int a ){
        return false;
    }
    public int firstBadVersion(int n) {
        int left =0,right = n;
        while(left<=right){
            int middle = left  + (right-left)/2 ;
            if(isBadVersion(middle)){
                right = middle -1;
            }else{
                left = middle +1;
            }
        }
        return left;
    }
}
